package com.funo.main.entities;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@Table(name = "U_USER_ROLE")
public class UserRole implements Serializable {

	private static final long serialVersionUID = 8733373157672840801L;
	
	// 主键Id
	@Id
	@Column(name = "USER_ROLE_ID")
	private String id;

	@ManyToOne
	@JoinColumn(name = "USER_ID")
	private User user;

	@ManyToOne
	@JoinColumn(name = "ROLE_ID")
	private Role role;

	//操作时间
	@Column(name = "OP_TIME")
	@Temporal(TemporalType.TIMESTAMP)
	private Date opTime;

	//操作人姓名
	@Column(name = "OP_USER_NAME")
	private String opUserName;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public Role getRole() {
		return role;
	}

	public void setRole(Role role) {
		this.role = role;
	}

	public Date getOpTime() {
		return opTime;
	}

	public void setOpTime(Date opTime) {
		this.opTime = opTime;
	}

	public String getOpUserName() {
		return opUserName;
	}

	public void setOpUserName(String opUserName) {
		this.opUserName = opUserName;
	}
	
}
